package com.esp.app.gps;

import android.content.Context;
import android.location.LocationManager;
import android.provider.Settings;
import android.util.Log;

import com.esp.app.widget.R;


public class GpsModel {
	
	private static final String TAG = GpsModel.class.getName();
	public final static String GPS_CHANGED_ACTION = "com.esp.app.gpsprovide.onProviderDisabled";
	
	public static int getGPSStatus(Context context){
		
		String providers = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED);
		boolean gpsOn = providers.contains(LocationManager.GPS_PROVIDER);
		Log.v(TAG," getGPSStatus :|=> " +  gpsOn);
		if (gpsOn)
			return R.drawable.gps_enabled;
		else
			return R.drawable.gps_disabled;
	}
}
